import sys
import time, datetime
flog=sys.stdout
def time_decorater(func):
    def wrapper(*args, **argkw):
        start = datetime.datetime.now()
        result = func(*args, **argkw)
        end = datetime.datetime.now()
        print >>flog, 'function: %s\tstart time: %s\t end time: %s\t use time: %d seconds' % \
                      (func.__name__, start.strftime("%y%m%d-%H:%M:%S"), end.strftime("%y%m%d-%H:%M:%S"), (end-start).seconds)
        return result 

    return wrapper 

def result_decorater(func):
    def result(*args, **argkw):
        pass 
